package com.cheetah.controller;

import org.springframework.security.access.annotation.Secured;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/product")
public class ProductController {

    @GetMapping("/findAll")
    @Secured("ROLE_PRODUCT")
//    @PreAuthorize("hasRole('ROLE_PRODUCT')")
//    @PreAuthorize("#oauth2.hasScope('read')") 这个不可以用感觉，要想用还需要找资料学习
    public String findAll(){
        return "产品列表查询成功";
    }

}
